package com.test.pack1.demo;

import edu.princeton.cs.algs4.StdDraw;

/**
 * Created by dws on 2017/10/24.
 */
public class VisualAccmulator {

    private double total;
    private int N;

    public VisualAccmulator(){}
    public VisualAccmulator(int trials,double max){
        StdDraw.setXscale(0,trials);
        StdDraw.setYscale(0,max);
        StdDraw.setPenRadius(.005);
    }

    public void addDataValue(double val){
        N++;
        total+=val;
        StdDraw.setPenColor(StdDraw.DARK_GRAY);
        StdDraw.point(N,val);
        StdDraw.setPenColor(StdDraw.RED);
        StdDraw.point(N,total/N);
    }

    public  void mean(){}


    public static void main(String[] args){

    }
}
